@nrwl/rspack |
您所在的位置:网站首页 › configure storybook › @nrwl/rspack |
The Nx plugin for Rspack. Rspack is a fast build tool written in Rust that is interoperable with the Webpack ecosystem. Why should you use this plugin? Instant dev server startLightning fast Hot-Module ReloadingFast builds using Rspack.Out-of-the-box support for TypeScript, JSX, CSS, and more.Compatible with the Webpack ecosystem.Read more about it in the Rspack documentation. Setting up a new Nx workspace with RspackYou can create a new React workspace that uses Rspack using this command: npx create-nx-workspace@latest --preset=@nrwl/rspackYou will be prompted for a repository name, which will be used for the folder and application name. Add Rspack to an existing workspaceThere are a number of ways to use Rspack in your existing workspace. First, make sure @nrwl/rspack is installed. npm i -D @nrwl/rspack@latest Generate a new React project using RspackThe easiest way to generate a new application that uses Rspack is by using the @nrwl/rspack:app generator. nx g @nrwl/rspack:app my-app --style=cssThen you should be able to serve, test, and build the application. nx serve my-app nx test my-app nx build my-app Generate a non-React project using RspackYou can generate a Web application, and then use the @nrwl/rspack:configuration generator to configure the build and serve targets. Make sure you have the Web plugin installed. npm i -D @nrwl/web@latestThen generate the application. nx g @nrwl/web:app my-app --style=cssFinally, configure Rspack for the new project. nx g @nrwl/rspack:configuration --project=my-app Modify an existing React or Web project to use RspackYou can use the @nrwl/rspack:configuration generator to change your React or Web project to use Rspack. This generator will modify your project's configuration to use Rspack, and it will also install all the necessary dependencies. You can read more about this generator on the @nrwl/rspack:configuration generator page. Initialize RspackIf you do not want to create any new projects or convert any existing projects yet, you can still use Nx to install all the necessary dependencies for Rspack. This, for example, could be useful if you want to set up Rspack manually for a project. nx g @nrwl/rspack:init |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |